#!/bin/env bash

PROFILE="$HOME/profile.d"
configure_bash () {
    if [ ! -d $PROFILE ]; then
        mkdir $PROFILE
    fi

    printf "copying scripts...\n"
    for script in ./bash/*.sh; do
        printf "include $script (y/n)? "
        read yes
        if [ $yes = "y" ]; then
            cp --verbose $script $PROFILE
        fi
    done

    cp --verbose ./bash/.bashrc $HOME/.bashrc
}

configure_vim () {
    cp --verbose "./vim/.vimrc" $HOME/.vimrc
    printf "which color theme (e.g. default, koehler, ...)? "
    read theme
    sed -i "s@color default@color $theme@g" "$HOME/.vimrc"  # not secure
}

configure_bash
configure_vim

printf "done\n"

exit

